#include <stdlib.h>
#include <string.h>
#include "iobot.h"

iobot_t* iobot_create(char* name, unsigned int x, unsigned int y, unsigned int w, unsigned int h)
{
	iobot_t* bot = (iobot_t*)malloc(sizeof(iobot_t));
	memset(bot, 0, sizeof(iobot_t));

	bot->name = name;
	bot->focused = 0;
	bot->x = x;
	bot->y = y;
	bot->width = w;
	bot->height = h;
	bot->textwidth = bot->width - 2;
	bot->textheight = bot->height - 2;

	iobot_update_input(bot);
	iobot_clear_input(bot);
	iobot_clear_output(bot);

	return bot;

}
